﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Utility
{
    public class ComboboxUlt
    {
        public static void LoadData(DataTable dataTable, ComboBox cbb, string[] fields, string firstIitemText)
        {
            DataTable dt = dataTable;
            DataRow dr = dt.NewRow();
            dr[fields[0]] = firstIitemText;
            dr[fields[1]] = "";
            dt.Rows.InsertAt(dr, 0);
            cbb.DataSource = dt;
            cbb.DisplayMember = fields[0];
            cbb.ValueMember = fields[1];
        }
    }
}
